/**
 * 
 */
package ing4;
import java.util.ArrayList;
import java.util.Random;

/**
 * @author dreena
 *
 */
public class Player {
		
		String name;
		int score;
		ArrayList<RPSEnum> moves;
		int i;
		public Player(String name, ArrayList<RPSEnum> moves)
		{
			this.i=0;
			this.name=name;
			this.moves=moves;
			this.score=0;
		}
		public Player(String name)
		{
			this.i=0;
			this.name=name;
			this.moves = new ArrayList<RPSEnum>();
			for(int j=0;j<10;j++)
			{
				Random r=new Random();
				switch (r.nextInt(3)) {
				case 0:
					this.moves.add(RPSEnum.PAPER);
					break;
				case 1:
					this.moves.add(RPSEnum.ROCK);
					break;
				case 2:
					this.moves.add(RPSEnum.SCISSORS);
					break;
				default:
					this.moves.add(RPSEnum.PAPER);
					break;
				}
			}
			this.score=0;
		}
		public String getName()
		{
			return this.name;
		}
		public int getScore() {
			return score;
		}
		public int getNumber(){
			return this.moves.size();
		}
		public void setScore(int score) {
			this.score = score;
		}
		public RPSEnum getNextMove()
		{
			this.i++;
			if(this.i>9)
				this.i=0;
			return this.moves.get(this.i);
		}
}
